<template>
  <el-main>
    <el-card class="box-card" style="margin-top: 30px">
      <div slot="header" class="clearfix">
        <span style="color: #000000; font-weight: 600">公告列表</span>
      </div>
      <div v-for="(item, index) in noticeList" :key="index" class="text item">
        <span style="font-weight: 600; font-size: 14px">{{
          item.noticeTitle
        }}</span>
        <span style="margin-left: 30px; font-size: 14px">{{
          item.noticeText
        }}</span>
        <span style="margin-left: 30px; font-size: 14px">{{
          item.createTime
        }}</span>
        <el-divider></el-divider>
      </div>
    </el-card>
  </el-main>
</template>

<script>
import { getTopListApi } from "@/api/notice.js";
import { getTotalApi } from "@/api/user.js";
export default {
  data() {
    return {
      noticeList: [],
    };
  },
  mounted() {
    this.getTopList();
  },
  methods: {
    //获取公告列表
    async getTopList() {
      let res = await getTopListApi();
      if (res && res.code == 200) {
        this.noticeList = res.data;
        console.log(this.noticeList);
      }
    },
  },
};
</script>


<style lang="scss" scoped>
.bottom-text {
  bottom: 0;
  width: 100%;
  background: rgba(0, 0, 0, 0.1);
  height: 25px;
  line-height: 25px;
  text-align: center;
  position: absolute;
  font-weight: 600;
}
.show-header {
  background: #00c0ef;
  color: #fff;
  height: 80px;
  border-radius: 5px;
  position: relative;
}
.show-num {
  font-size: 38px;
  font-weight: 600;
  padding: 5px;
}
</style>
